package intopo.game.impl.givetake;

/**
 * An enumeration that represents the available actions in an iteration of
 * the Give-Take game.

 * @author <a href="mailto:plmariano@gmail.com">Pedro Lopes da Silva Mariano</a>

 * @version 1.0
 */
public enum GiveTakeAction
{
	NONEG ("noneg", '-', true, false),
	GIVE ("give", 'G', true, true),
	NONET ("nonet", '-', false, false),
	TAKE ("take", 'T', false, true);

	/**
	 * A word that describes this action.
	 */
	String description;

	/**
	 * A char that is used when printing the history of a game.
	 */
	char code;

	/**
	 * Indicates if this action is performed only when the player has the
	 * resource.
	 */
	boolean withResource;

	/**
	 * Indicates if this action transfers the resource to the other player.
	 */
	boolean switchesResource;

	/**
	 * Constructs an action with the given parameters.
	 *
	 * @param description a word that describes the action
	 * @param code a char used when printing a history of a game
	 * @param withResource indicates if this action must be performed by the
	 * player that has the resource
	 * @param switchesResource indicates if this action will change the
	 * ownership of the resource
	 */
	private GiveTakeAction (String description, char code, boolean withResource, boolean switchesResource)
	{
		this.description = description;
		this.code = code;
		this.withResource = withResource;
		this.switchesResource = switchesResource;
	}
}
